<?php
/*
	结算明细
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
cfc('core')->checklogin();
set_html('tabs','我的结算');
if($_RQ['op']=='main'){
	$return['setting']=$this->plugin_setting('page');
	
	$return['balance_total']=price($this->sum('balance',array('merchid'=>$_SESSION['onemerchid'],'mid'=>$_SESSION['uid']),'money'));
	$return['params']=array(
		'page'=>1,
		'status'=>3,
	);
	$return['list']=array();
	exi($return);
}
if($_RQ['op']=='list'){
	$params=array('merchid'=>$_SESSION['onemerchid'],'mid'=>$_SESSION['uid']);
	
	$params['status']=intval($_RQ['status']);
	$psize=20;
	$pindex=intval($_RQ['page'])?:1;
	$parameter=array(
		'params'=>$params,
		'limit'=>array($pindex,$psize),
		
	);
	$list=$this->get_list('balance',$parameter);
	if(!$list){
		exi('none');
	}
	
	exi($list);
}
?>